#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QTimer>
#include "musicplayer.h"

namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT
    
public:
    explicit MainWindow(QWidget *parent = 0);    
    ~MainWindow();
    
private slots:
    void on_playButton_clicked();
    void on_stopButton_clicked();
    void on_pauseButton_clicked();
    void on_addButton_clicked();
    void createPlaylist();
    void changeTrack();
    void setVolume(int position);
    void setPosition(int position);
    void setBalance(int position);

    void on_nextButton_clicked();
    void on_previousButton_clicked();
    void on_removeButton_clicked();
    void on_cleanButton_clicked();
    void maxValue();

    void sliderMove();

    void eq1S(int level);
    void eq2S(int level);
    void eq3S(int level);
    void eq4S(int level);
    void eq5S(int level);
    void eq6S(int level);
    void eq7S(int level);
    void eq8S(int level);
    void eq9S(int level);
    void eq10S(int level);
    void eq11S(int level);
    void eq12S(int level);
    void eq13S(int level);
    void eq14S(int level);
    void eq15S(int level);
    void eq16S(int level);
    void eq17S(int level);
    void eq18S(int level);

    void on_resetEQ_clicked();    

//  Chorus
    void on_chActive_clicked();
    void chMixSet(int level);
    void chDepthSet(int level);
    void chFBSet(int level);
    void chFreqSet(int level);
    void chDelaySet(int level);
    void chPhase(int index);
    void chWFSet(int index);
    void chReset();

//    Echo
    void on_eActive_clicked();
    void eMixSet(int level);
    void eFBSet(int level);
    void eRightDSet(int level);
    void eLeftDSet(int level);
    void eSwapSet();
    void on_eReset_clicked();
    void on_equalSwitch_clicked();
    void on_eSyncLR_clicked();
    void on_eSyncRL_clicked();
    void on_eSync2_clicked();

//    Flanger
    void on_flActive_clicked();
    void flMixSet(int level);
    void flDepthSet(int level);
    void flFBSet(int level);
    void flFreqSet(int level);
    void flDelaySet(int level);
    void flPhaseSet(int index);
    void flWFSet(int index);
    void on_flReset_clicked();

//    Reverb
    void on_reverbActive_clicked();
    void revGainSet(int level);
    void revMixSet(int level);
    void revTimeSet(int level);
    void revRatioSet(int level);
    void on_revReset_clicked();

//    Gargle
    void on_garActive_clicked();
    void garRateSet(int level);
    void garWFSet(int index);
    void on_garReset_clicked();

//    Distortion
    void on_distActive_clicked();
    void disGainSet(int level);
    void disEdgeSet(int level);
    void disFreqSet(int level);
    void disBWSet(int level);
    void disPLCSet(int level);
    void on_distReset_clicked();

//    SampleRate
    void sampRateSet(int level);

    void on_TPSreset_clicked();

private:
    Ui::MainWindow *ui;
    musicPlayer player;
    HSTREAM stream;
    QStringList fileNames;
    QLabel *status;// to status bar
    int state;// -1 - stream is empty, 0 - stop, 1 - playing, 2 - pause;
    int currentTrack;
    QTimer timer;
    bool echoSync;

private:
    QString parseFileName(QString fname);
    void beginPlaying ();
};

#endif // MAINWINDOW_H
